package com.example.demo.controller;

import com.example.demo.dto.vo.UserVO;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/login")
    public String userLogin(UserVO userVO) {
        return userService.userLogin(userVO.getUsername(),userVO.getPassword());
    }

    @RequestMapping("/loginA")
    public String userLoginA(
            @RequestParam(value = "abc", required = false) String abc) {
        return userService.userLogin(abc, abc);
    }
}
